home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
JCSM Shareware Collection 1993 November
/
JCSM Shareware Collection - 1993-11.iso
/
cl720
/
qbnws21j.lzh
/
LARGEEXE.BAS
< prev
next >
Wrap
BASIC Source File
|
1991-01-26
|
2KB
|
92 lines
REM $TITLE: 'LARGEEXE'
' How to create a LARGE QB EXEcutable
' T. G. Muench January 1991
REM $INCLUDE: 'C:\QBASIC\QB.BI'
DEFINT A-Z
' Constants
CONST FALSE = 0
CONST TRUE = NOT FALSE
Initialization:
ON ERROR GOTO ErrorTrap
' Data for BASIC READ
DATA 1,2,3,4,5,6,7,8,9,10
DATA Now,is,the,time,for,all,good,persons,to,come
' I/O channel
CHAN = 1
REM $PAGE
StartProgram:
PRINT : PRINT "Integers"
START! = TIMER
FOR I = 1 TO 10
READ DATA$
PRINT I, VAL(DATA$)
NEXT I
PRINT "Ticks = "; 18.2 * (TIMER - START!)
INPUT "Press Enter to continue: ", ENTRY$
PRINT : PRINT "Strings"
START! = TIMER
FOR I = 11 TO 20
READ DATA$
PRINT I, DATA$
NEXT I
PRINT "Ticks = "; 18.2 * (TIMER - START!)
INPUT "Press Enter to continue: ", ENTRY$
PRINT : PRINT "Read ASCII file:"
INPUT "File to read? ", FILE$
IF FILE$ = "" THEN
BEEP : PRINT "No file specified"
ELSE
INPUT "Display lines (Y,N)? ", ENTRY$
IF UCASE$(ENTRY$) = "Y" THEN
DISPLAY = TRUE
ELSE
DISPLAY = FALSE
END IF
START! = TIMER
OPEN FILE$ FOR INPUT AS #CHAN
DO UNTIL EOF(CHAN)
LINE INPUT #CHAN, LINE$
COUNT = COUNT + 1
IF DISPLAY THEN
PRINT LINE$
END IF
LOOP
CLOSE #CHAN
PRINT : PRINT "Read"; COUNT; "lines"
PRINT "Ticks = "; 18.2 * (TIMER - START!)
END IF
GOTO EndProgram
REM $PAGE
ErrorTrap:
IF ERR = 53 THEN
BEEP : PRINT "File not found"
RESUME EndProgram
ELSE
BEEP : PRINT "Unexpected error "; ERR
RESUME EndProgram
END IF
EndProgram:
END